package com.pingan.haofang.searchcloud.web.monitor.controller;

import com.pingan.haofang.searchcloud.common.constants.WebConstants;
import com.pingan.haofang.searchcloud.monitor.dto.SearchcloudStatusResultDTO;
import com.pingan.haofang.searchcloud.monitor.service.SearchcloudMonitorService;
import com.pingan.haofang.searchcloud.web.monitor.form.DateTimeRangeForm;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author EX-LIUXIANWEN001
 * @date 2018/10/31
 * @since 1.0.0
 */
@RestController
@RequestMapping(WebConstants.WEB_PREFIX + "/searchcloudMonitorInfo")
@Api(tags = "searchcloudMonitorInfo", description = "搜索云监控总览")
public class SearchcloudMonitorController {

    @Autowired
    private SearchcloudMonitorService searchcloudMonitorService;


    @ApiOperation("总览数据")
    @GetMapping("/top")
    public SearchcloudStatusResultDTO querySearchcloudMonitorInfo(DateTimeRangeForm form){

        return searchcloudMonitorService.querySearchcloudStatus(form.getFromTime(), form.getToTime());
    }

}
